#!/usr/bin/env python

import sqlalchemy as sa

from datetime import datetime
from model import DeclarativeBase

__all__ = ['Message']

class Message(DeclarativeBase):
    '''Message class
    
    @author Julot <andy.julot@gmail.com>
    @since Tuesday, April 17, 2012. 05:02 PM'''
    
    __tablename__ = 'messages'
    
    id = sa.Column(sa.Integer, primary_key=True)
    createdAt = sa.Column(sa.DateTime, default=datetime.now, index=True)
    updatedAt = sa.Column(sa.DateTime, default=datetime.now,
                          onupdate=datetime.now, index=True)
    pdu = sa.Column(sa.Text)
    decompiled = sa.Column(sa.Boolean, index=True)
    sender = sa.Column(sa.String(255))
    dateTime = sa.Column(sa.DateTime)
    total = sa.Column(sa.Integer)
    sequence = sa.Column(sa.Integer, index=True)
    reference = sa.Column(sa.Integer)
    message = sa.Column(sa.Text)
    uploaded = sa.Column(sa.Boolean, index=True)
